/**
 *  本工具js用于在ajax中引入重定向功能
 *  created on 2019-04-18 by ysy
 */
function redirectHandle(XHR) {
	console.log("complete");
	var enable = XHR.getResponseHeader("enableRedirect");
	console.log("enableRedirect = " + enable);
	if(enable){
		alert("会话过期！！");
		var url = XHR.getResponseHeader("redirectUrl");
		console.log("redirectUrl = " + url);
		window.sessionStorage.clear();
        window.top.location.href = url;
	}
}

$(function () {
    $(document).ajaxComplete(function (event, XHR, settings) {
        console.log("ajax complete start!!")
        redirectHandle(XHR);
    })
})